<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
<script type="text/javascript">
    var arr=[2,2,2,3,4,5,3,1,2,5];
    const s=new Set();
    arr.forEach(x => s.add(x));
    for(let i of s){
        console.log(i);
    }
</script>
</body>
</html>